package com.xmall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xmall.order.define.dto.OrderRefundDto;
import com.xmall.order.define.dto.platform.OrderRefundDtoForAdmin;
import com.xmall.order.entity.OrderRefund;
import com.xmall.order.define.request.refund.*;

import java.util.List;

/**
 * <p>
 * 订单退款退货 服务类
 * </p>
 *
 * @author xmall
 * @since 2023-11-26
 */
public interface IOrderRefundService extends IService<OrderRefund> {

    /**
     * 过滤掉拒绝状态的记录
     */
    List<OrderRefundDto> listWithoutInvalidByOrderId(Long orderId);

    /**
     * 售后列表
     */
    List<OrderRefundDto> listByOrderId(Long orderId);

    /**
     * 检查是否有退款未处理
     */
    Boolean hasUnhandledRefund(Long orderId);

    /**
     * 获取订单子项售后状态
     */
    String getOrderItemRefundStatusName(Long orderId, Long orderItemId);

    /**
     * 售后列表
     */
    OrderRefundDtoForAdmin listForAdmin(Long orderId);

    /**
     * 售前申请退款
     */
    void applyRefund(OrderApplyRefundRequest request);

    /**
     * 售后申请退款
     */
    void applyReturn(OrderApplyReturnRequest request);

    /**
     * 售前退款：同意
     */
    void approveRefund(Long id);

    /**
     * 售后退款：同意
     */
    void approveReturn(Long id);

    /**
     * 售前退款：拒绝
     */
    void refuseRefund(OrderRefuseRefundRequest request);

    /**
     * 售后退款：拒绝
     */
    void refuseReturn(OrderRefuseReturnRequest request);

    /**
     * 退货发货
     */
    void returnDelivery(OrderReturnDeliveryRequest request);

    /**
     * 退货收货
     */
    void returnDeliveryReceive(Long id);
}
